package com.yunfeng.web.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.yunfeng.web.pojo.TestStudent;

import javax.transaction.Transactional;

@Transactional //事务操作，并发执行任务，若一个操作失败，则其他成功操作回退不执行
public interface TestStudentRepository extends JpaRepository<TestStudent,String> //第一个参数表示所操作的实体类名称，第二个参数表示实体类中主键的类型。
,JpaSpecificationExecutor<TestStudent>{

	@Query("from TestStudent where Student_name=:Student_name and Student_age=:Student_age and Student_sex=:Student_sex and Student_id=:Student_id")
	List<TestStudent> findByConditions(@Param("Student_name") String Student_name, @Param("Student_age") Integer Student_age
												, @Param("Student_sex") String Student_sex, @Param("Student_id") String Student_id);

	
}
